<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Boot WMS</title> 
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css"> 
  <!-- Ionicons -->
  <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css"> 
  <!-- Tempusdominus Bbootstrap 4 -->
  <link rel="stylesheet" href="plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css">
  <!-- iCheck -->
  <link rel="stylesheet" href="plugins/icheck-bootstrap/icheck-bootstrap.min.css">
  <!-- JQVMap -->
  <link rel="stylesheet" href="plugins/jqvmap/jqvmap.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="dist/css/adminlte.min.css">
  <!-- overlayScrollbars -->
  <link rel="stylesheet" href="plugins/overlayScrollbars/css/OverlayScrollbars.min.css">
  <!-- Daterange picker -->
  <link rel="stylesheet" href="plugins/daterangepicker/daterangepicker.css">

  <!-- jsGrid -->
  <link rel="stylesheet" href="plugins/jsgrid/jsgrid.min.css">
  <link rel="stylesheet" href="plugins/jsgrid/jsgrid-theme.min.css">
  
  <!-- summernote -->
  <link rel="stylesheet" href="plugins/summernote/summernote-bs4.css"> 
  <!-- Google Font: Source Sans Pro -->
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
</head>
<body class="hold-transition sidebar-mini layout-fixed">
<div class="wrapper">

  <!-- Navbar -->
  <nav class="main-header navbar navbar-expand navbar-white navbar-light">  
	<div id="test1"></div> 
	<div id="test2"></div>
    
    <ul class="navbar-nav ml-auto"> 
		<div id="test3"></div> 
		<div id="test4"></div>
		<li class="nav-item">
		  <a class="nav-link" data-widget="control-sidebar" data-slide="true" href="#">
		    <i class="fas fa-th-large"></i>
		  </a>
		</li>
    </ul>
  </nav>
  <!-- /.navbar -->

  <aside class="main-sidebar sidebar-dark-primary elevation-4">
  	<div id="logo1"></div> 
    <div class="sidebar">
		<div id="user1"></div>
		<nav class="mt-2">
			 <ul class="nav nav-pills nav-sidebar flex-column" 
			 	 data-widget="treeview" 
			 	 role="menu" 
			 	 data-accordion="false">
			 	<div id="menu1"></div> 
		 	 </ul>
		</nav>
  	</div> 
  </aside>  

  
  <div class="content-wrapper">
  	<!-- 主区域标题 -->
    <section class="content-header">
   		<!-- 查询出库信息 -->
      <div class="container-fluid">
      	<div class="row mb-2">
      		<div class="col-sm-9">
      		  <h1 class="m-0 text-dark">
   				出库信息
      		  </h1>
      		</div>
      		<div class="col-sm-1">
      		<button type="button"
	   				class="btn btn-block btn-primary"
	   				data-toggle="modal"
	   				data-target="#modal-addNewSO"      		
	   				onclick = "clearField()" 
      		>
      		  新增SO
      		</button>
      		</div>
   			<div class="col-sm-2">
   				<ol class="breadcrumb float-sm-right">
   					<li class="breadcrumb-item"><a href="./index.html">主页</a></li>
   					<li class="breadcrumb-item active">SO信息</li>
   				</ol>
   			</div>
      	</div>      
      </div>   
    </section>

    <section class="content">
    	<div class="card">
    		<div class="card-header">
    			<h3 class="card-title">SO列表</h3>
    		</div>
    		<div class="card-body">
    			<div id="jsGrid1"></div>
    		</div>
    	</div>
    </section>

  </div>
 
<div class="modal fade" id="modal-addNewSO">
 <div class="modal-dialog modal-lg">
  	<div class="modal-content">
  	  <div class="modal-header">
  	  	<h4 class="modal-title">新增SO</h4>
  	  	<button type="button" class="close" data-dismiss="modal" aria-label="Close">
  	  	  <span aria-hidden="true">&times;</span>
  	  	</button>
  	  </div>
  		
     <div class="modal-body">
       <p>新增窗口</p>
    	 <hr/> 
 			 <div class="card-body">
 			 		<!-- 新增SO -->
      	  <form action="" name="post_form" id="post_form" role="form">
      	  	<div class="row">

		  				<div class="col-sm-3">
								<div class="form-group">
			  					<label>出库单号</label>
									<input type="text" id="ASNID" name="ASNID" class="form-control" placeholder="">
								</div>
		  				</div>
		  				<div class="col-sm-3">
								<div class="form-group">
			  					<label>客户编号</label>
									<input type="text" id="ASNID" name="ASNID" class="form-control" placeholder="">
								</div>
		  				</div>
		  				<div class="col-sm-3">
								<div class="form-group">
			  					<label>发货日期</label>
									<input type="text" id="ASNID" name="ASNID" class="form-control" placeholder="">
								</div>
		  				</div>
		  				<div class="col-sm-3">
								<div class="form-group">
			  					<label>配货日期</label>
									<input type="text" id="ASNID" name="ASNID" class="form-control" placeholder="">
								</div>
		  				</div>

      	  	</div>      	  	
      	  	<div class="row">

		  				<div class="col-sm-3">
								<div class="form-group">
			  					<label>总件数</label>
									<input type="text" id="ASNID" name="ASNID" class="form-control" placeholder="">
								</div>
		  				</div>
		  				<div class="col-sm-3">
								<div class="form-group">
			  					<label>包装类型</label>
									<input type="text" id="ASNID" name="ASNID" class="form-control" placeholder="">
								</div>
		  				</div>
		  				<div class="col-sm-3">
								<div class="form-group">
			  					<label>业务编号</label>
									<input type="text" id="ASNID" name="ASNID" class="form-control" placeholder="">
								</div>
		  				</div>
		  				<div class="col-sm-3">
								<div class="form-group">
			  					<label>发票编号</label>
									<input type="text" id="ASNID" name="ASNID" class="form-control" placeholder="">
								</div>
		  				</div>
		  				
      	  	</div>   
      	  	<div class="row">

		  				<div class="col-sm-3">
								<div class="form-group">
			  					<label>运输类型</label>
									<input type="text" id="ASNID" name="ASNID" class="form-control" placeholder="">
								</div>
		  				</div>
		  				<div class="col-sm-3">
								<div class="form-group">
			  					<label>备注1</label>
									<input type="text" id="ASNID" name="ASNID" class="form-control" placeholder="">
								</div>
		  				</div>
		  				<div class="col-sm-3">
								<div class="form-group">
			  					<label>备注2</label>
									<input type="text" id="ASNID" name="ASNID" class="form-control" placeholder="">
								</div>
		  				</div>
		  				<div class="col-sm-3">
								<div class="form-group">
			  					<label>备注3</label>
									<input type="text" id="ASNID" name="ASNID" class="form-control" placeholder="">
								</div>
		  				</div>
		  				
      	  	</div>   
      	  	<div class="row">

		  				<div class="col-sm-3">
								<div class="form-group">
			  					<label>备注4</label>
									<input type="text" id="ASNID" name="ASNID" class="form-control" placeholder="">
								</div>
		  				</div>
		  				<div class="col-sm-3">
								<div class="form-group">
			  					<label>备注5</label>
									<input type="text" id="ASNID" name="ASNID" class="form-control" placeholder="">
								</div>
		  				</div>
		  				<div class="col-sm-3">
								<div class="form-group">
			  					<label>备注6</label>
									<input type="text" id="ASNID" name="ASNID" class="form-control" placeholder="">
								</div>
		  				</div>
		  				<div class="col-sm-3">
								<div class="form-group">
			  					<label>创建日期</label>
									<input type="text" id="ASNID" name="ASNID" class="form-control" placeholder="">
								</div>
		  				</div>
		  				
      	  	</div>   
      	  </form>
 			 </div>
     </div>
  	 <div class="modal-footer justify-content-between">
       <button type="button" class="btn btn-default" data-dismiss="modal">
       	关闭</button>
       <button type="button" onclick="confirmedAdd()" data-dismiss="modal" 
       	class="btn btn-primary">确认添加</button>
     </div>
  	</div>
 </div>
</div>  
  
<div id="footer"></div>
  
<!-- jQuery -->
<script src="plugins/jquery/jquery.min.js"></script>
<!-- jQuery UI 1.11.4 -->
<script src="plugins/jquery-ui/jquery-ui.min.js"></script>
<!-- Bootstrap 4 -->
<script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script>

<!-- jsgrid -->
<script src="plugins/jsgrid/jsgrid.min.js"></script>

<!-- AdminLTE App -->
<script src="dist/js/adminlte.js"></script>
</body>
<script type="text/javascript">
  
	
	(function($){
		console.log("start");

		localStorage.setItem("menuId", 3);
		
		//$("#mainHeader").load("mainHeader1.html");
		$("#test1").load("test1.html");
		$("#test2").load("test2.html");
		$("#test3").load("test3.html");
		$("#test4").load("test4.html");
		$("#logo1").load("logo1.html");
		$("#user1").load("user1.html");
		$("#menu1").load("menu1.html");
		$("#footer").load("foot.html");

		initialData();

		iniTableData(); 
	})(jQuery);

	function initialData(){
		console.log("SOList initialData()");

		setTimeout(function () { 
			console.log("initialData changeActive4");
			changeMenuActive(3);
    },1000);
	}

	function iniTableData(){
		console.log("iniTableData()");

		var data1 = {};
		var url1 = "";

		$ajax({
			type: "post",
			url: url1,
			dataType: "json",
			data: data1,
			success: function(res){
				console.log(res);
				// jsGrid1

				$("#jsGrid1").jsGrid({
					height: "510px",
					width: "100%",
					paging: true,
					pageSize: 10,
					data: res,
					rowDoubleClick: function(args){
						showDetailDialog2(args);
					},
					fields:[
						{name:"id", type: "number", width:55,title:"主键编码"},
						{name:"SOID", type: "number", width:55,title:"出库编号"},
						{name:"SONum", type: "text", width:55,title:"出库单号"},
						{name:"storekey", type: "text", width:55,title:"客户编号"},
						{name:"createDate", type: "number", width:55,title:"创建日期",
							editButton: false,
							itemTemplate: function(value,item){
								return timestampToString(value)
							}
						},
						{name:"shipDate", type: "number", width:55,title:"发货日期",
							editButton: false,
							itemTemplate: function(value,item){
								return timestampToString(value)
							}
						},
						{name:"localDate", type: "number", width:55,title:"配货日期",
							editButton: false,
							itemTemplate: function(value,item){
								return timestampToString(value)
							}
						},
						{name:"totalPkg", type: "number", width:55,title:"总件数"},
						{name:"pkgType", type: "text", width:55,title:"包装类型"},
						{name:"bussNum", type: "text", width:55,title:"业务编号"},
						{name:"invoiceNum", type: "text", width:55,title:"发票编号"},
						{name:"transType", type: "text", width:55,title:"运输类型"},
						{name:"remark1", type: "text", width:55,title:"备注1"},
						{name:"remark2", type: "text", width:55,title:"备注2"},
						{name:"remark3", type: "text", width:55,title:"备注3"},
						{name:"remark4", type: "text", width:55,title:"备注4"},
						{name:"remark5", type: "text", width:55,title:"备注5"},
						{name:"remark6", type: "text", width:55,title:"备注6"},
						{
							type:"control",
							width: 85,
							modeSwitchButton: true,
							itemTemplate: function(value, item){
								if(item.remark6==='FINISH'){
									return '不可删除'
								}
								return $("<button>").attr("type","button").text("删除")
									.addClass("btn btn-block btn-default")
									.on("click",function(e){
										showDeleteDialog1("del",value,item);
									});
							}
						}
					],
				});
			},
			error: function(e){
				console.log(e);
			}
		});
	}

	function showDeleteDialog1(type,value,item){
		console.log("showDeleteDialog1-=>",type,value,item);
	}

	function clearField(){
		console.log("clearField()");
	}

	function confirmedAdd(){
		console.log("confirmedAdd()");
	}

</script>
</html>